package greentycoon.gui;
import greentycoon.main.VariablesGlobales;
import greentycoon.ville.Ville;

import java.awt.Frame;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JComponent;
import javax.swing.JFrame;

public class Fenetre extends JFrame implements ConteneurListener,EnvironmentListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4673235227926412068L;
	private Ville ville;
	private Panneau panneau;
	private MenuCreation menuCreation;

	public Fenetre(MenuCreation menuCreation, Ville ville) {

		this.ville = ville;
		this.menuCreation=menuCreation;

		setExtendedState(MAXIMIZED_BOTH);
		setUndecorated(true);
		Toolkit outil = getToolkit();
		setSize(outil.getScreenSize()); 

		setTitle("Green Tycoon");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		panneau = new Panneau(ville, getWidth(), getHeight(), menuCreation);
		add(panneau);

		setVisible(true);
	}

	public void repaint() {
		panneau.repaint();
	}

	@Override
	public void actionEnvironmentListener() {
		panneau.repaint();

	}

	@Override
	public void actionConteneurListener(int i, int j) {
		panneau.repaint();

	}

}
